import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

// 菜单默认
export const menus = [
    {
        key: 'task',
        label: '一级菜单',
        icon: 'el-icon-s-operation',
        hidden: false,
        subs: [
            {
                key: 'taskCenter',
                label: '二级菜单',
            },
        ],
    },
]

// 默认基础路由
const initMenu = []

// 白名单--免权限校验
export const whiteListMenu = [
    {
        path: '/task/taskCenter/alarmTask/TaskDetail',
        name: 'taskDetail',
        component: () => import('@/views/Home'),
        meta: {
            icon: 'el-icon-s-operation',
            label: '免校验路由',
        },
    },
]
// 全部路由
export const routesAll = [
    {
        path: '/',
        redirect: '/Home',
    },
    {
        path: '/Home',
        name: 'Home',
        component: () => import('@/views/Home.vue'),
        meta: {
            cName: '实况一览',
        },
    },
    {
        path: '/*',
        name: '*',
        meta: {},
        component: () => import('@/views/UnderConstruction'),
    },
]

const router = new VueRouter({
    routes: initMenu,
    base: '/',
})

export default router
